
#include "../mpmdComm.hpp"
#include "mpi.h"
#include <cassert>
#include <iostream>
#include <vector>
using namespace std;
using namespace EXTREAM;
int main(int argc, char **argv) {

  int my_rank, num_proc;
  MPI_Init(&argc, &argv);

  MpmdComm::getObjPtr()->init(MPI_COMM_WORLD);
  // POFile::initWithMultiAPP(MpmdComm::getObjPtr()->localComm(),
  //                          MpmdComm::getObjPtr()->appId(), true);

  const int local_comm_size = MpmdComm::getObjPtr()->localCommSize();
  const int remote_comm_size = MpmdComm::getObjPtr()->remoteCommSize();
  const int local_rank = MpmdComm::getObjPtr()->rankInLocal();
  //   vector<int> send_data(remote_comm_size * 2, local_rank);
  int value = 19;
  if (local_rank == 1)
    MPI_Bcast(&value, 1, MPI_INT, MPI_ROOT, MpmdComm::getObjPtr()->interComm());
  else {
    MPI_Bcast(nullptr, 0, MPI_INT, MPI_PROC_NULL,
              MpmdComm::getObjPtr()->interComm());
  }

  MpmdComm::release();
  MPI_Finalize();
  return 0;
}